home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 12157 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: ix.netcom.com!netnews
  2. From: jlilley@ix.netcom.com (John Lilley)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Newbie Q, please Help
  5. Date: 18 Mar 1996 17:28:40 GMT
  6. Organization: Netcom
  7. Message-ID: <4ik6g8$14k@reader2.ix.netcom.com>
  8. References: <4ii7pc$d27@news-e2c.gnn.com>
  9. NNTP-Posting-Host: den-co8-14.ix.netcom.com
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-NETCOM-Date: Mon Mar 18  9:28:40 AM PST 1996
  13. X-Newsreader: WinVN 0.99.7
  14.  
  15. In article <4ii7pc$d27@news-e2c.gnn.com>, ScottDrane@gnn.com says...
  16. >
  17. >     I'm getting a linker error when trying to
  18. >compile my latest project:
  19. >     Segment MYPROGRAM_TEXT exceeds 64K
  20.  
  21. You didn't mention the compiler, but they all have some option
  22. like "far data threshold" or "segment threshold", which defaults
  23. to something like 32k.  Set this to something like 256.
  24.  
  25. Secondly if you have any large static arrays like:
  26.     int myData[2048];
  27. make it explicitly far:
  28.     int far myData[2048];
  29.  
  30. Third, you can edit your DEF file and decrease the stack space
  31. a bit to say, 10240, but be careful as that can cause stack
  32. overflow problems.
  33.  
  34. >     I tried to recompile under a different
  35. >memory model, but the compiler told me
  36. >Windows only works with the large model.
  37. >Can anyone straighten me out?
  38.  
  39. This is not true -- Windows 3.x supports tiny, medium, compact,
  40. and large -- but "large" model is the best you can do
  41. under Windows 3.x without resorting to "huge", which is
  42. not supported by the standard libraries.  You could also
  43. compile with Win32s and get a flat address space; that's
  44. somewhat involved but may be worth it if the above does not help.
  45.  
  46. john lilley
  47.  
  48.